package edu.xpu.project.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import edu.xpu.project.user.entity.ExamPlaceEntity;
import edu.xpu.project.user.service.ExamPlaceService;

/**
 * @ClassName: ExamPlaceController.java
 * @Description: 考场信息控制器
 *
 * @author liukang
 * @date 2017年5月22日 下午2:52:08
 * @version 
 * @since JDK 1.6
 */
@Controller
@RequestMapping(value="examPlace")
public class ExamPlaceController {
	@Autowired
	private ExamPlaceService examPlaceService;
	
	@RequestMapping(value="examPlaceList")
	public String examPlaceList(@RequestParam(value="pageNumber", defaultValue="1", required=false) String pageNumber,
			@RequestParam(value="pageSize", defaultValue="10", required=false) String pageSize,
			ExamPlaceEntity placeEntity, ModelMap modelMap) {
		Page<ExamPlaceEntity> pageByCriterias = examPlaceService.getPageByCriterias(pageNumber, pageSize, placeEntity);
		modelMap.addAttribute("page", pageByCriterias)
		.addAttribute("searchVal", placeEntity)
		.addAttribute("number", pageNumber)
		.addAttribute("size", pageSize);
		return "stuAttachPage/examPlaceList";
	}

}

